package com.hdaccp.shuiguoD.service.impl;

import com.hdaccp.shuiguoD.dao.yuangongDao;
import com.hdaccp.shuiguoD.entity.Gongying;
import com.hdaccp.shuiguoD.entity.Yuangong;
import com.hdaccp.shuiguoD.service.yuangongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class yuangongServiceImpl implements yuangongService {
    @Autowired
    private yuangongDao yuangongDao;
    @Override
    public List<Yuangong> getAll() {
        return yuangongDao.queryAll();
    }

    @Override
    public long findTotalCount(String yname) {
        return yuangongDao.getTotalCount(yname);
    }

    @Override
    public List<Yuangong> findAll(String yname, int offset, int limit) {
        return yuangongDao.query(yname,offset,limit);
    }

    @Override
    public int delte(int yid) {
        return yuangongDao.delet(yid);
    }

    @Override
    public int zj(Yuangong yuangong) {
        return yuangongDao.add(yuangong);
    }

    @Override
    public int update(Yuangong yuangong) {
        return yuangongDao.update(yuangong);
    }

    @Override
    public Yuangong queryById(int yid) {
        return yuangongDao.queryById(yid);
    }
}
